wayland: Use g_message for logging
authorMatthias Clasen <mclasen@redhat.com>
Fri, 12 Jan 2018 12:40:38 +0000 (07:40 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 14 Jan 2018 22:05:04 +0000 (17:05 -0500)
g_printerr is not the best for this.

gdk/wayland/gdkclipboard-wayland.c
gdk/wayland/gdkdnd-wayland.c
gdk/wayland/gdkkeys-wayland.c
gdk/wayland/gdkprimary-wayland.c
gdk/wayland/gdkselection-wayland.c

index 97d0934694551a83ac085c369043255d51268828..25671ff6703116bd331a604fb0974f2873663a5a 100644 (file)
@@ -77,7 +77,7 @@ gdk_wayland_clipboard_data_source_target (void                  *data,
                                           struct wl_data_source *source,
                                           const char            *mime_type)
 {
-  GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (data)), CLIPBOARD, g_printerr ("%p: Huh? data_source.target() events?\n", data));
+  GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (data)), CLIPBOARD, g_message ("%p: Huh? data_source.target() events?", data));
 }
 
 static void
@@ -89,7 +89,7 @@ gdk_wayland_clipboard_write_done (GObject      *clipboard,
 
   if (!gdk_clipboard_write_finish (GDK_CLIPBOARD (clipboard), result, &error))
     {
-      GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (clipboard)), CLIPBOARD, g_printerr ("%p: failed to write stream: %s\n", clipboard, error->message));
+      GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (clipboard)), CLIPBOARD, g_message ("%p: failed to write stream: %s", clipboard, error->message));
       g_error_free (error);
     }
 }
@@ -103,7 +103,7 @@ gdk_wayland_clipboard_data_source_send (void                  *data,
   GdkWaylandClipboard *cb = GDK_WAYLAND_CLIPBOARD (data);
   GOutputStream *stream;
 
-  GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (data)), CLIPBOARD, g_printerr ("%p: data source send request for %s on fd %d\n",
+  GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (data)), CLIPBOARD, g_message ("%p: data source send request for %s on fd %d",
                                    source, mime_type, fd));
 
   mime_type = gdk_intern_mime_type (mime_type);
@@ -125,7 +125,7 @@ gdk_wayland_clipboard_data_source_cancelled (void                  *data,
 {
   GdkWaylandClipboard *cb = GDK_WAYLAND_CLIPBOARD (data);
 
-  GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (data)), CLIPBOARD, g_printerr ("%p: data source cancelled\n", data));
+  GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (data)), CLIPBOARD, g_message ("%p: data source cancelled", data));
 
   if (cb->source == source)
     {
@@ -139,7 +139,7 @@ gdk_wayland_clipboard_data_source_dnd_drop_performed (void                  *dat
                                                       struct wl_data_source *source)
 {
   GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (data)),
-            CLIPBOARD, g_printerr ("%p: Huh? data_source.dnd_drop_performed() events?\n", data));
+            CLIPBOARD, g_message ("%p: Huh? data_source.dnd_drop_performed() events?", data));
 }
 
 static void
@@ -147,7 +147,7 @@ gdk_wayland_clipboard_data_source_dnd_finished (void                  *data,
                                                struct wl_data_source *source)
 {
   GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (data)),
-            CLIPBOARD, g_printerr ("%p: Huh? data_source.dnd_finished() events?\n", data));
+            CLIPBOARD, g_message ("%p: Huh? data_source.dnd_finished() events?", data));
 }
 
 static void
@@ -156,7 +156,7 @@ gdk_wayland_clipboard_data_source_action (void                  *data,
                                           uint32_t               action)
 {
   GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (data)),
-            CLIPBOARD, g_printerr ("%p: Huh? data_source.action() events?\n", data));
+            CLIPBOARD, g_message ("%p: Huh? data_source.action() events?", data));
 }
 
 static const struct wl_data_source_listener data_source_listener = {
@@ -222,7 +222,7 @@ gdk_wayland_clipboard_read_async (GdkClipboard        *clipboard,
   g_task_set_source_tag (task, gdk_wayland_clipboard_read_async);
 
   GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD, char *s = gdk_content_formats_to_string (formats);
-                       g_printerr ("%p: read for %s\n", cb, s);
+                       g_message ("%p: read for %s", cb, s);
                        g_free (s); );
   mime_type = gdk_content_formats_match_mime_type (formats, cb->offer_formats);
   if (mime_type == NULL)
@@ -305,7 +305,7 @@ gdk_wayland_clipboard_claim_remote (GdkWaylandClipboard  *cb,
 
   if (cb->source)
     {
-      GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD, g_printerr ("%p: Ignoring clipboard offer for self\n", cb));
+      GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD, g_message ("%p: Ignoring clipboard offer for self", cb));
       gdk_content_formats_unref (formats);
       return;
     }
@@ -313,7 +313,7 @@ gdk_wayland_clipboard_claim_remote (GdkWaylandClipboard  *cb,
   gdk_wayland_clipboard_discard_offer (cb);
 
   GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD, char *s = gdk_content_formats_to_string (formats);
-                       g_printerr ("%p: remote clipboard claim for %s\n", cb, s);
+                       g_message ("%p: remote clipboard claim for %s", cb, s);
                        g_free (s); );
   cb->offer_formats = formats;
   cb->offer = offer;
index dc7055ada22dfea0c22f32e09e239eb17c5ec180..d6927017a54d940f5d2f7c773a3b435968d80e89 100644 (file)
@@ -336,7 +336,7 @@ gdk_wayland_drag_context_read_async (GdkDragContext      *context,
   g_task_set_source_tag (task, gdk_wayland_drag_context_read_async);
 
   GDK_DISPLAY_NOTE (display, DND, char *s = gdk_content_formats_to_string (formats);
-                 g_printerr ("%p: read for %s\n", context, s);
+                 g_message ("%p: read for %s", context, s);
                  g_free (s); );
   dnd_formats = gdk_wayland_selection_get_targets (display);
   mime_type = gdk_content_formats_match_mime_type (formats, dnd_formats);
index da23fca2583dc0b9620992856e2205380513e9b7..cad938f5f02bfc091bc83e28acf62c14c7472647 100644 (file)
@@ -625,7 +625,7 @@ _gdk_wayland_keymap_update_from_fd (GdkKeymap *keymap,
       return;
     }
 
-  GDK_DISPLAY_NOTE (keymap->display, INPUT, g_print ("keymap:\n%s\n", map_str));
+  GDK_DISPLAY_NOTE (keymap->display, INPUT, g_message ("keymap:\n%s", map_str));
 
   xkb_keymap = xkb_keymap_new_from_string (context, map_str, format, 0);
   munmap (map_str, size);
index 8558bba607b8cf380393c95aca3a01e8e44d4f72..89f02e65ffc0940ed67b43d1bc360eb3dcb3a2cd 100644 (file)
@@ -99,7 +99,7 @@ gdk_wayland_primary_claim_remote (GdkWaylandPrimary                  *cb,
 
   if (cb->source)
     {
-      GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD, g_printerr ("%p: Ignoring clipboard offer for self\n", cb));
+      GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD, g_message ("%p: Ignoring clipboard offer for self", cb));
       gdk_content_formats_unref (formats);
       return;
     }
@@ -107,7 +107,7 @@ gdk_wayland_primary_claim_remote (GdkWaylandPrimary                  *cb,
   gdk_wayland_primary_discard_offer (cb);
 
   GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD, char *s = gdk_content_formats_to_string (formats);
-                       g_printerr ("%p: remote clipboard claim for %s\n", cb, s);
+                       g_message ("%p: remote clipboard claim for %s", cb, s);
                        g_free (s); );
   cb->offer_formats = formats;
   cb->offer = offer;
@@ -125,7 +125,7 @@ primary_offer_offer (void                               *data,
 
   if (cb->pending != offer)
     {
-      GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), SELECTION, g_printerr ("%p: offer for unknown selection %p of %s\n",
+      GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), SELECTION, g_message ("%p: offer for unknown selection %p of %s",
                                        cb, offer, type));
       return;
     }
@@ -144,7 +144,7 @@ primary_selection_data_offer (void                                *data,
 {
   GdkWaylandPrimary *cb = data;
 
-  GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), SELECTION, g_printerr ("%p: new primary offer %p\n",
+  GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), SELECTION, g_message ("%p: new primary offer %p",
                                    cb, offer));
 
   gdk_wayland_primary_discard_pending (cb);
@@ -173,7 +173,7 @@ primary_selection_selection (void                                *data,
 
   if (cb->pending != offer)
     {
-      GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), SELECTION, g_printerr ("%p: ignoring unknown data offer %p\n",
+      GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), SELECTION, g_message ("%p: ignoring unknown data offer %p",
                                        cb, offer));
       return;
     }
@@ -199,7 +199,7 @@ gdk_wayland_primary_write_done (GObject      *clipboard,
 
   if (!gdk_clipboard_write_finish (GDK_CLIPBOARD (clipboard), result, &error))
     {
-      GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (clipboard)), SELECTION, g_printerr ("%p: failed to write stream: %s\n", clipboard, error->message));
+      GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (clipboard)), SELECTION, g_message ("%p: failed to write stream: %s", clipboard, error->message));
       g_error_free (error);
     }
 }
@@ -213,7 +213,7 @@ gdk_wayland_primary_data_source_send (void                                *data,
   GdkWaylandPrimary *cb = GDK_WAYLAND_PRIMARY (data);
   GOutputStream *stream;
 
-  GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (data)), SELECTION, g_printerr ("%p: data source send request for %s on fd %d\n",
+  GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (data)), SELECTION, g_message ("%p: data source send request for %s on fd %d",
                                    source, mime_type, fd));
 
   mime_type = gdk_intern_mime_type (mime_type);
@@ -235,7 +235,7 @@ gdk_wayland_primary_data_source_cancelled (void                                *
 {
   GdkWaylandPrimary *cb = GDK_WAYLAND_PRIMARY (data);
 
-  GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (data)), CLIPBOARD, g_printerr ("%p: data source cancelled\n", data));
+  GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (data)), CLIPBOARD, g_message ("%p: data source cancelled", data));
 
   if (cb->source == source)
     {
@@ -303,7 +303,7 @@ gdk_wayland_primary_read_async (GdkClipboard        *clipboard,
   g_task_set_source_tag (task, gdk_wayland_primary_read_async);
 
   GDK_DISPLAY_NOTE (gdk_clipboard_get_display (clipboard), CLIPBOARD, char *s = gdk_content_formats_to_string (formats);
-                       g_printerr ("%p: read for %s\n", cb, s);
+                       g_message ("%p: read for %s", cb, s);
                        g_free (s); );
   mime_type = gdk_content_formats_match_mime_type (formats, cb->offer_formats);
   if (mime_type == NULL)
index c5220afcab95b089162d6755dbc3cc0e01b5211f..0db6bad4ad12b4abeb1c352996fab030b8388052 100644 (file)
@@ -311,7 +311,7 @@ gdk_wayland_drag_context_write_done (GObject      *context,
 
   if (!gdk_drag_context_write_finish (GDK_DRAG_CONTEXT (context), result, &error))
     {
-      GDK_DISPLAY_NOTE (gdk_drag_context_get_display (GDK_DRAG_CONTEXT (context)), DND, g_printerr ("%p: failed to write stream: %s\n", context, error->message));
+      GDK_DISPLAY_NOTE (gdk_drag_context_get_display (GDK_DRAG_CONTEXT (context)), DND, g_message ("%p: failed to write stream: %s", context, error->message));
       g_error_free (error);
     }
 }
@@ -329,7 +329,7 @@ data_source_send (void                  *data,
   if (!context)
     return;
 
-  GDK_DISPLAY_NOTE (gdk_drag_context_get_display (context), DND, g_printerr ("%p: data source send request for %s on fd %d\n",
+  GDK_DISPLAY_NOTE (gdk_drag_context_get_display (context), DND, g_message ("%p: data source send request for %s on fd %d\n",
                              source, mime_type, fd));
 
   //mime_type = gdk_intern_mime_type (mime_type);